package com.wcj.common;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.DetachedCriteria;

public interface WcjCommonBiz<T> {
	
	public T get( Serializable id );
	public T load( Serializable id );
	public void save( T entity );
	public void saveAll( Collection<T> entitys );
	public void saveOrUpdate( T entity );
	
	public List<T> findByCriteria( DetachedCriteria criteria );
	
	public Page pagedQuery( DetachedCriteria criteria, int pageNo, int pageSize);
	public Page pagedQuery( Criteria criteria, int pageNo, int pageSize);
	
	public void deleteObj( T entity );	
	public void deleteObjById( Serializable id);	
	public void deleteObjByIds( Serializable[] ids );
	
	public T findUniqueObj( String name, Object value );
	
	public List<T> findByLike( String name, String value );
	
	public List<T> loadAll();
	
	public List<T> findAll();
	
	public boolean isNotUnique(T entity, String names);
}
